﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Learn_Default
{
    class Program
    {
        static void Main(string[] args)
        {
            double x = default(int);
            Console.WriteLine(x);  // 0


            // 枚举类型默认的值固定是0，如果Mid = 0，即默认是Mid，如果没有0，在使用default操作符时可能出现错误
            Level level = default(Level);
            Console.WriteLine(level);

            //Form myForm = new Form() { Text = "Hello World!" , FormBorderStyle = FormBorderStyle.SizableToolWindow};
            //myForm.ShowDialog();

            var person = new { Name = "Mr.OKay", Age = 34 };
            Console.WriteLine(person.Name);
            Console.WriteLine(person.Age);
            Console.WriteLine(person.GetType().Name);

            Student stu = new Student();
            stu.Report();
            CsStudent csStu = new CsStudent();
            csStu.Report();
        }
    }

    enum Level
    {
        Low = 0,
        Mid = 1,
        High = 2
    }

    class Student
    {
        public void Report()
        {
            Console.WriteLine("I'm a student.");
        }
    }

    class CsStudent: Student
    {

    }
}
